package cn.yshujia.transform;

import cn.yshujia.domain.entity.Album;
import cn.yshujia.domain.vo.AlbumVO;

import java.util.ArrayList;
import java.util.Arrays;

/**
 * @author YShuJia
 * @create 2025/3/4
 * @description AlbumTransform
 */

public class AlbumTransform {
	
	public static AlbumVO entity2VO(Album album) {
		if (album == null) {
			return null;
		}
		AlbumVO albumVO = new AlbumVO();
		albumVO.setId(album.getId());
		albumVO.setRoleId(album.getRoleId());
		albumVO.setLabelId(album.getLabelId());
		albumVO.setTitle(album.getTitle());
		albumVO.setPaths(new ArrayList<>(Arrays.asList(album.getPath().split(","))));
		albumVO.setIntroduction(album.getIntroduction());
		albumVO.setCreateTime(album.getCreateTime());
		albumVO.setStatus(album.getStatus());
		return albumVO;
	}
}
